package net.lahuobao.finance.entity.accountrecord;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;
import org.jeecgframework.core.util.StringUtil;

import net.lahuobao.finance.entity.organizationEntity.OrganizationEntity;

import javax.persistence.SequenceGenerator;

/**   
 * @Title: Entity
 * @Description: 账户明细记录表
 * @author zhangdaihao
 * @date 2016-09-05 13:25:01
 * @version V1.0   
 *
 */
//@Entity
//@Table(name = "account_record", schema = "lahuobao")
//@DynamicUpdate(true)
//@DynamicInsert(true)
//@SuppressWarnings("serial")
public class AccountRecord implements java.io.Serializable {
		
		private Integer id;
		
		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		private Integer accountRecordId;

	    private Long accountId;

	    private Integer creditId;

	    private Integer debitiId;

	    private Integer orderId;

	    private Short operateType;
	    
	    private String operateTypeStr;

	    public String getOperateTypeStr() {
	    	String type="";
	    	for(EAccountRecordType e:EAccountRecordType.values()){
	    		if(e.getValue().equals(operateType)){
	    			type=e.getName();
	    		}
	    	}
			return type;
		}

		public void setOperateTypeStr(String operateTypeStr) {
			this.operateTypeStr = operateTypeStr;
		}

		public String getStatusStr() {
			String type="";
	    	for(EAccountRecordStatus e:EAccountRecordStatus.values()){
	    		if(e.getValue().equals(status)){
	    			type=e.getName();
	    		}
	    	}
			return type;
		}

		public void setStatusStr(String statusStr) {
			this.statusStr = statusStr;
		}

		private BigDecimal amount;

	    private String remark;

	    private Short status;
	    
	    private String statusStr;

	    private Timestamp operateTime;

	    private String operateTimeStr;

	    private Integer operateId;

	    private Integer payRecordId;

	    private Integer alipayRecordId;

	    private OrganizationEntity organization;

	    private BigDecimal total;

	    private BigDecimal usable;

	    private String bankAccountName;
	    private String toBankAccountName;
	    private String toBankAccountNo;

	    public String getToBankAccountName() {
			return toBankAccountName;
		}

		public void setToBankAccountName(String toBankAccountName) {
			this.toBankAccountName = toBankAccountName;
		}

		public String getToBankAccountNo() {
			return toBankAccountNo;
		}

		public void setToBankAccountNo(String toBankAccountNo) {
			this.toBankAccountNo = toBankAccountNo;
		}

		private String alipayName;

	    public String getOperateTimeStr() {
	    	SimpleDateFormat sft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	        return operateTimeStr=sft.format(operateTime);
	    }

	    public void setOperateTimeStr(String operateTimeStr) {
	        this.operateTimeStr = operateTimeStr;
	    }
	    
//	    @Id
//		@GeneratedValue(strategy = GenerationType.IDENTITY)
//		@Column(name ="account_record_id",nullable=false,precision=10,scale=0)
	    public Integer getAccountRecordId() {
	        return accountRecordId;
	    }

	    public void setAccountRecordId(Integer accountRecordId) {
	        this.accountRecordId = accountRecordId;
	    }

	

		public Long getAccountId() {
			return accountId;
		}

		public void setAccountId(Long accountId) {
			this.accountId = accountId;
		}

		//@Column(name ="credit_id",nullable=true)
	    public Integer getCreditId() {
	        return creditId;
	    }

	    public void setCreditId(Integer creditId) {
	        this.creditId = creditId;
	    }
		//@Column(name ="debitI_id",nullable=true)
	    public Integer getDebitiId() {
	        return debitiId;
	    }

	    public void setDebitiId(Integer debitiId) {
	        this.debitiId = debitiId;
	    }
		//@Column(name ="order_id",nullable=true)
	    public Integer getOrderId() {
	        return orderId;
	    }

	    public void setOrderId(Integer orderId) {
	        this.orderId = orderId;
	    }
		//@Column(name ="operate_type",nullable=false)
	    public Short getOperateType() {
	        return operateType;
	    }

	    public void setOperateType(Short operateType) {
	        this.operateType = operateType;
	    }
		//@Column(name ="amount",nullable=false)
	    public BigDecimal getAmount() {
	        return amount;
	    }

	    public void setAmount(BigDecimal amount) {
	        this.amount = amount;
	    }
		//@Column(name ="remark",nullable=true)
	    public String getRemark() {
	        return remark;
	    }

	    public void setRemark(String remark) {
	        this.remark = remark == null ? null : remark.trim();
	    }
		//@Column(name ="status",nullable=true)
	    public Short getStatus() {
	        return status;
	    }

	    public void setStatus(Short status) {
	        this.status = status;
	    }
	
	
	

	

		public Timestamp getOperateTime() {
			return operateTime;
		}

		public void setOperateTime(Timestamp operateTime) {
			this.operateTime = operateTime;
		}

		//@Column(name ="operate_id",nullable=false)
	    public Integer getOperateId() {
	        return operateId;
	    }

	    public void setOperateId(Integer operateId) {
	        this.operateId = operateId;
	    }
		//@Column(name ="pay_record_Id",nullable=false)
	    public Integer getPayRecordId() {
	        return payRecordId;
	    }

	    public void setPayRecordId(Integer payRecordId) {
	        this.payRecordId = payRecordId;
	    }
		//@Column(name ="alipay_record_id",nullable=false)
	    public Integer getAlipayRecordId() {
	        return alipayRecordId;
	    }

	    public void setAlipayRecordId(Integer alipayRecordId) {
	        this.alipayRecordId = alipayRecordId;
	    }

	    public void setOrganization(OrganizationEntity organization) {
	        this.organization = organization;
	    }
	    public OrganizationEntity getOrganization() {
	        return organization;
	    }
	    public BigDecimal getTotal() {
	        return total;
	    }

	    public void setTotal(BigDecimal total) {
	        this.total = total;
	    }

	    public BigDecimal getUsable() {
	        return usable;
	    }

	    public void setUsable(BigDecimal usable) {
	        this.usable = usable;
	    }

	    public String getBankAccountName() {
	        return bankAccountName;
	    }

	    public void setBankAccountName(String bankAccountName) {
	        this.bankAccountName = bankAccountName == null ? null : bankAccountName.trim();
	    }

	    public String getAlipayName() {
	        return alipayName;
	    }

	    public void setAlipayName(String alipayName) {
	        this.alipayName = alipayName == null ? null : alipayName.trim();
	    }
}
